<?php

use yii\db\Migration;

/**
 * Handles the creation of table `{{%library_book}}`.
 */
class m230511_123022_create_library_book_table extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->createTable('{{%library_book}}', [
            'id' => $this->primaryKey(),
            'author' => $this->string(),
            'title' => $this->string(400)->notNull(),
            'year' => $this->smallInteger(),
            'annotation' => $this->text(),
        ]);
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        $this->dropTable('{{%library_book}}');
    }
}
